/**
 * 
 */
package com.hanhai.zrb.model.project.enums;

/**
 * @author pbh
 *
 */
public enum ProReasonTypeEnums {

	NOTCANCLE(0,"未取消"),
	CANCLE(101,"我不想看了"),
	TRAVEL(102,"行程有变"),
	CONFIRM(103,"信息错误重新提交"),
	OTHER(104,"其它"),
	;
	
	private Integer code;
	
	private String value;
	
	public Integer getCode() {
		return code;
	}

	public String getValue() {
		return value;
	}

	private ProReasonTypeEnums(int code,String value){
		this.code = code;
		this.value = value;
	}
	
	public static String  getValueByCode(int code){
		for(ProReasonTypeEnums status:ProReasonTypeEnums.values()){
			if(status.getCode() == code){
				return status.getValue();
			}
		}
		return null;
	}
	
	public static ProReasonTypeEnums getByCode(int code){
		for(ProReasonTypeEnums status:ProReasonTypeEnums.values()){
			if(status.getCode() == code){
				return status;
			}
		}
		return null;
	}
	
	public static void main(String[] args) {

		for(ProReasonTypeEnums status :ProReasonTypeEnums.values()){
			System.out.println("code="+status.getCode()+ " values = "+status.getValue());
		}
	}
}
